from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic

import core.models

def content_types(request):
    model_types = [ContentType.objects.get_for_model(core.models.Request)]
    final_dict = {}
    for model_type in model_types:
        final_dict[model_type.model + '_content_type'] = model_type.id
        final_dict[model_type.model + '_model'] = model_type.model
    return final_dict

def status(request):
    feature_count = core.models.Request.objects.filter(mode = 'Feature').exclude(status = 'Completed').exclude(status = 'WontFix').count()
    bug_count = core.models.Request.objects.filter(mode = 'Bug').exclude(status = 'Completed').exclude(status = 'WontFix').count()
    
    return {'feature_count':feature_count, 'bug_count':bug_count}